describe('app session', function(){
    var S_SERVICE_ID = 'serviceID',
			S_CLIENT_USERNAME = 'ybankuser',
			S_CLIENT_PASSWORD = 'password',
			S_CHANNEL = 'IBKBMW',
			S_COUNTRY = 'IN',
			S_LANGUAGE = 'en';
    beforeEach(function (){
    	App.initSession();
    });
	it('init breezeContext in session when user visits breeze', function(){
		var t_session = App.getSession();
		expect(t_session.getBreezeContext()).toEqual(
			{
			clientContext : {
				country : S_COUNTRY,
				channel : S_CHANNEL,
				userName : S_CLIENT_USERNAME,
				password : S_CLIENT_PASSWORD
			},
			serviceContext : {
				serviceId : S_SERVICE_ID,
				token : null,
				nonce : null,
                otpToken: null
			},
			userContext : {
				userId : null,
				sessionId : null,
				language : S_LANGUAGE
			},
            rumContext : {
                rumData : ''
            }});
	});
	
	it('update session when user login seccess ', function(){
		var t_session = App.getSession();
		t_session.setUserId('INUSER00001');
		t_session.setNonce('0000010001');
		var t_sessionId = '1000001001', 
				t_securityCode = '200000011', 
				t_expectToken = b64_sha1(['IN', t_sessionId, 'INUSER00001', S_SERVICE_ID, t_securityCode].join('|'));
		t_session.updateSession(t_sessionId, t_securityCode);
		expect(t_session.getBreezeContext().serviceContext.token).toEqual(t_expectToken);
		
	});
	
});